<%@ page import="java.util.List"%>
<%@ page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn"  uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form"uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<%@page import="biblioteca.persistencia.*"%>
<%@page import="biblioteca.dao.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="icon" type="image/vnd.microsoft.icon" href="/favicon.ico"/>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    <link type="text/css" rel="stylesheet" href="/stylesheets/menu.css"/>
    <link rel="icon" type="image/vnd.microsoft.icon" href="/favicon.ico"/>

        
        
<title>Noticias</title>



</head>

<body>
    
   

    
    <c:choose>
        <c:when test="${!empty plantilla}">
            <c:forEach var="noticia" items="${plantilla}">
                <fieldset>
                    <fieldset>
                        <center> <lege2nd>Noticias</legend> </center>
                        <c:out value="${noticia.titulo}:"/>
                            
                        <c:out value="${noticia.contenido}"/>
                    </fieldset>
                    <table>
                     <tr>
                        <td>
                        <sec:authorize access="hasRole('ROLE_ADMIN')">
                        <form action="/borrarNoti" method="post">
                        <input type="submit" value="borrar"/>
                        <input type="hidden" name="id" value="${noticia.id}" />
                        </form>
                        </sec:authorize>
                         </td>
                    </table>
                </fieldset>
            </c:forEach>
        </c:when>
        <c:otherwise>
            <center>No hay noticias nuevas</center>
        </c:otherwise>
    </c:choose>
            

	
</body>

</html>